UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOFegZYCK/EBZ/ekOqnld+QhTbiNl0mNrdhYpM0QM6c='
WHERE
key_id = '152b1cb5986af45c0d85ed3ca0930d9562702a4216888973ccb278be976fa6f0'
AND (
token = 'uOFegZYCK/EBZ/ekOqnld+QhTbiNl0mNrdhYpM0QM6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)