UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/zB+V2cgBaRiCo19q9hGybJUu0EaawCdTj9NCzIv9g0=' 
WHERE 
  key_id = '79e4e75807170f084b19f7dc1b227f76472b25cb46f9258fcd713a21c5ed98c4' 
  AND (
    token = '/zB+V2cgBaRiCo19q9hGybJUu0EaawCdTj9NCzIv9g0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030