UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Qti/+kkfhPPqQMtk/Qa3lywzzxTalDOGgqBUknRPYc=' 
WHERE 
  key_id = 'a49df65e25aa57372b8f0c28fc2abc94a0e6deb610fa278e4478eb17511f151e' 
  AND (
    token = '0Qti/+kkfhPPqQMtk/Qa3lywzzxTalDOGgqBUknRPYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025