UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gMvHtRMM409eF665RK/6n5CCA59X5k6BRWOv5uIoNzI=' 
WHERE 
  key_id = 'd4b7f116fa8943c96e5e94f71268fcd4bf10fe3fb27f6a7010e4bc691f00509e' 
  AND (
    token = 'gMvHtRMM409eF665RK/6n5CCA59X5k6BRWOv5uIoNzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023