UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UD+wfupKET8/lcfap7ZIiSaEuqUwUeE7egKooNHcYjg=' 
WHERE 
  key_id = '576f151dd3b5a8a7482f0e064e78186c8cd5611291128be4c02cc24f3cb60bd5' 
  AND (
    token = 'UD+wfupKET8/lcfap7ZIiSaEuqUwUeE7egKooNHcYjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021