UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Lv8FLFIvIbwLDt5wrOhcUp+hy4oMVcTT1y9Z9eVS4k=' 
WHERE 
  key_id = '799343af9c56cf810042fc2e4ad649e69349dbe364e5d2abc0445f7712eb69b6' 
  AND (
    token = '8Lv8FLFIvIbwLDt5wrOhcUp+hy4oMVcTT1y9Z9eVS4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033