UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3PTS/DIENmJ7eyEC0nRX4fGXJAgIUTdaOzl0HeVcLP0=' 
WHERE 
  key_id = '0003d0e845b86b7949afe1b4d1a9ea86d34580e1bf0b247be316c38a96582f89' 
  AND (
    token = '3PTS/DIENmJ7eyEC0nRX4fGXJAgIUTdaOzl0HeVcLP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061