UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FNGaN1y5FYOdhv5auUrZBYownx8sgk8MEkI6GafhUC8=' 
WHERE 
  key_id = '33197f300dab3a0bf7aa5c70f6bd17e08aceb043b306ed9d48ff5afd1efbf277' 
  AND (
    token = 'FNGaN1y5FYOdhv5auUrZBYownx8sgk8MEkI6GafhUC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037