UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DX5xxyGLHcIGGQbBe40SVLSTD8DmQRPnNSzC9nCLY+U=' 
WHERE 
  key_id = '6c6b8d1754a6ea7b28143afb3d7d280277516d0906fb7238d6031dd783d7f991' 
  AND (
    token = 'DX5xxyGLHcIGGQbBe40SVLSTD8DmQRPnNSzC9nCLY+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022