UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fe+qpriBOQVXIwrxKMwMHMkUWErNbCuGbLr9385lhmI=' 
WHERE 
  key_id = '4c4484b56d939add4c9cf04077d46703346df92587508cda0f815327b874d747' 
  AND (
    token = 'Fe+qpriBOQVXIwrxKMwMHMkUWErNbCuGbLr9385lhmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033