UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+/Lu6q1rYzddQDxFRGpR1trsj2fwBMFhWda0SZ2o+lw=' 
WHERE 
  key_id = '34b81c5782852fcd1f047db76768e914a5636aae2534b83adc558328d7eccc80' 
  AND (
    token = '+/Lu6q1rYzddQDxFRGpR1trsj2fwBMFhWda0SZ2o+lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072