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