UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mqQFefpSnPlZ48Ku3E1Xvk+dTEFZs18WzB6e/2FXIxI='
WHERE
key_id = '9b05eaa0bc1addbfd0d2d54e6119bdeb142bb447bb5e546e2c3f93858d2adaf6'
AND (
token = 'mqQFefpSnPlZ48Ku3E1Xvk+dTEFZs18WzB6e/2FXIxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)