UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gola0qRaeh2siEwILPxuwOhHnjPAiE+0dUjvqhxUCV0=' 
WHERE 
  key_id = '24bebebf6da4576765270dd330b30782c735c28a4e323cdaf42a3545ba08927f' 
  AND (
    token = 'Gola0qRaeh2siEwILPxuwOhHnjPAiE+0dUjvqhxUCV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018