UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't3TizqHaAYa1O+qj21LW+sPN64dIlwyXBuKQcFwQyAs='
WHERE
key_id = '4773dcb83e598a4d06c3c665a78ecf1242a0a8dcd4cbcc78ffcfeaa926e11d84'
AND (
token = 't3TizqHaAYa1O+qj21LW+sPN64dIlwyXBuKQcFwQyAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)