UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1uc4ZWwk9XKfm/RjtuZs9MMTMTH6URcI+39Aq/tFin8=' 
WHERE 
  key_id = '19dce63a915238b4e3d19d970ff387d21201c8c486373911b6d9731fa0af2f88' 
  AND (
    token = '1uc4ZWwk9XKfm/RjtuZs9MMTMTH6URcI+39Aq/tFin8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032