UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CGR3y6WfXRRT+SBcPaiBSAI82JU03vhQt741d9U3RjA=' 
WHERE 
  key_id = '19c5e085c339f70d5fd30bb092b0c612a88fc1bdd60dfa33a5ca8ca8224c08cf' 
  AND (
    token = 'CGR3y6WfXRRT+SBcPaiBSAI82JU03vhQt741d9U3RjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029