UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LTILeIhDHzzstkqgCo1H7FGVx94rJ5iLiQoUdZy3DRI=' 
WHERE 
  key_id = '9ad5808a192fd2c40815bf3da8ae5deadb51eb9cac63af0404e9db393b701788' 
  AND (
    token = 'LTILeIhDHzzstkqgCo1H7FGVx94rJ5iLiQoUdZy3DRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069