UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OMQh+7nRKJEGwQ+BrI3vrQLnUw6ww8/+v/3CJJ0C36Y=' 
WHERE 
  key_id = 'b173d70dc5230e3955dfc324251870e706e5c432ab77e87d87c288c4ca37490b' 
  AND (
    token = 'OMQh+7nRKJEGwQ+BrI3vrQLnUw6ww8/+v/3CJJ0C36Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033