UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PnlY/N160YZuyA0UO6ZfcxKc1IEha7WG31eUN+mQJkA=' 
WHERE 
  key_id = '6e946b79fba02e6022f6d89cbc79efbdd562a51ab395c4a818ba67ce979cbda2' 
  AND (
    token = 'PnlY/N160YZuyA0UO6ZfcxKc1IEha7WG31eUN+mQJkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032