UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iIP9mq2uKDFO9s6djhyKJPx8LTUUk9i2jm/1KSusXaY='
WHERE
key_id = '9bdc29b3cc1bfb1325019edba9fba6c0abc3a666d630b43b05aba07dae02179c'
AND (
token = 'iIP9mq2uKDFO9s6djhyKJPx8LTUUk9i2jm/1KSusXaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)