UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FvWvasvGeAkNOlP7RPHn0q7x9S+vK/3aoc/DIZVXxQs=' 
WHERE 
  key_id = '9f88504c147c59f3b7869372aa80bc1caaf630e624619fb49f639fb2abb9c31d' 
  AND (
    token = 'FvWvasvGeAkNOlP7RPHn0q7x9S+vK/3aoc/DIZVXxQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044