UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3AW4tOjifsHDcMCd4fTNgtrIgOqxvFJeqsfPE2rLkEE=' 
WHERE 
  key_id = '1d044cc551775b0d1b4e5bbb14066fed22af97b5db616a4c6282efc2bcd7419c' 
  AND (
    token = '3AW4tOjifsHDcMCd4fTNgtrIgOqxvFJeqsfPE2rLkEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046