UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCNAE6O/fuH1P1C3m+VfQxkqT6hYiylyBCdpXmlylMw=' 
WHERE 
  key_id = '713fab8baf84c8349ef06a04f588c8cd39404d602f4a14446f23ffd6dc492f2e' 
  AND (
    token = 'rCNAE6O/fuH1P1C3m+VfQxkqT6hYiylyBCdpXmlylMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036