UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUGVj7yzCqwMV448cDsmOLL5qWCjzvIuYLpXD7qShrM='
WHERE
key_id = '7f3fac1a576afb47c7c35ddabaab84373d268f14542c769e11d10dfb2db40fe0'
AND (
token = 'xUGVj7yzCqwMV448cDsmOLL5qWCjzvIuYLpXD7qShrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)