UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6yxyyf3uaSbcEZo/jZWThO0UjJGORCBvx/DhOKPVYAk=' 
WHERE 
  key_id = '6aa2b6b2f104ebefc0f6ce26054d989052ef606f1d0904899fee900655a7cc42' 
  AND (
    token = '6yxyyf3uaSbcEZo/jZWThO0UjJGORCBvx/DhOKPVYAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037