UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hfvpQANr8e6Vy8AfuuXY/pLA3CJxv6hB4YGOLKjNNn4=' 
WHERE 
  key_id = 'ab07eacd00b3e621f8389cdc04a6eab7aebf317b0b6e6b0f375a892e17189c83' 
  AND (
    token = 'hfvpQANr8e6Vy8AfuuXY/pLA3CJxv6hB4YGOLKjNNn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040