UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LUl9mYb1hPf2g+S3Mmq+JK+iMlnQWdKlI6y/JJXUz+I=' 
WHERE 
  key_id = '9d4445916ad986bf061eb4bf6f7e256f8ed10a0864566d0f7f98e08a7ac8baf8' 
  AND (
    token = 'LUl9mYb1hPf2g+S3Mmq+JK+iMlnQWdKlI6y/JJXUz+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034