UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jebXxx3pE1x6eFZN/mbpvhk0bXnpANveE2KqPkkpqks=' 
WHERE 
  key_id = '1e3de0ba79c2b10497b01836437a748f2c623b590b849be142997d13110e72a3' 
  AND (
    token = 'jebXxx3pE1x6eFZN/mbpvhk0bXnpANveE2KqPkkpqks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035