UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RKJjbdofsdr7u2f0uh73yZFmtiNec16ar7G+7otsqjs=' 
WHERE 
  key_id = '5639e61bd995286f466e25db21f49a2579aa1e125111224032b3c1409b5cab74' 
  AND (
    token = 'RKJjbdofsdr7u2f0uh73yZFmtiNec16ar7G+7otsqjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061