UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LXT+Ka1KWfns4ZPAQG3KmhoBar/gYE0ZBJ5aGROZo5s=' 
WHERE 
  key_id = '75f8184bea3b8cd22daeddd51e4c5c6943496d2f703103585453731c140639e6' 
  AND (
    token = 'LXT+Ka1KWfns4ZPAQG3KmhoBar/gYE0ZBJ5aGROZo5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050