UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FaIzcNat9drpJ9wGdhusPBhJQyVkdSv20JaoNugcJvA=' 
WHERE 
  key_id = '17d2108f0d0655b5874a15f64524f457df070b8e99b3fed05a813d38fcfcaad5' 
  AND (
    token = 'FaIzcNat9drpJ9wGdhusPBhJQyVkdSv20JaoNugcJvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038