UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BdGOOWC+Fsm+6m/3G4JGQ9CWm+XFG57HUl4JViDHuVM=' 
WHERE 
  key_id = 'c53aa58ebb54cb2083d19ff16bd5ebdc683b409f683070af418dc624a40e76be' 
  AND (
    token = 'BdGOOWC+Fsm+6m/3G4JGQ9CWm+XFG57HUl4JViDHuVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033