UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAo5fp2ommIfQOCviwCYc7mqhMqSFRs1m4gfIGM/Kv8=' 
WHERE 
  key_id = '1283224997e6674969890cfadc31924d085bd722f4ff8b726d60bf70c2bf7e0f' 
  AND (
    token = 'RAo5fp2ommIfQOCviwCYc7mqhMqSFRs1m4gfIGM/Kv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014