UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y6nyeaC7UZwg4UhLpDlbVkvKdCik1foL1h5Kdnt67aM=' 
WHERE 
  key_id = '4d09bab652f11130806715bca0c5098dae0f50100e6e6d992a64f4958517db07' 
  AND (
    token = 'Y6nyeaC7UZwg4UhLpDlbVkvKdCik1foL1h5Kdnt67aM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028