UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HV2o7LCp2Kj0IFR0Frm4Z+WSPm1/W2gbSNJAVpdC5ho=' 
WHERE 
  key_id = '115150e2aa64b09718c2194b34938e1b06a6f8f3a6e9117a8246c9b88dc80782' 
  AND (
    token = 'HV2o7LCp2Kj0IFR0Frm4Z+WSPm1/W2gbSNJAVpdC5ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028