UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8QYSpFSdZ2LFBVj9x0DXJaDUidMW9iNPu2DY4dPyb94=' 
WHERE 
  key_id = '9373d5c106043452c3af87cc4500aa22d846a51f62424d42c7b7cdcdd4f7ac01' 
  AND (
    token = '8QYSpFSdZ2LFBVj9x0DXJaDUidMW9iNPu2DY4dPyb94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053