UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQNR3uorkBMMoTAp/pYC2ipQKluaOTTuOyQOxGQgMXA=' 
WHERE 
  key_id = '70aba3a4793a1834cdc6d9cd724fd983adbab11632c8f55b7f96079a1799a9f2' 
  AND (
    token = 'eQNR3uorkBMMoTAp/pYC2ipQKluaOTTuOyQOxGQgMXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033