UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4+902ctrSogX3TEA/8Tx1FDO5QaRB5bkAXzIDvM8MWU=' 
WHERE 
  key_id = 'a3f89caa5611c062e655815547a718cf29dd24aae4cccf45e8629a3806305a71' 
  AND (
    token = '4+902ctrSogX3TEA/8Tx1FDO5QaRB5bkAXzIDvM8MWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038