UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7WXgxlHNHfEpAE8Ei7//tgfNOCzp7H017txpUYo6C3M='
WHERE
key_id = '4ecb1a5cf20393fd0299d0751a54dc27e84b4858e9d12540d30432afd03cdde9'
AND (
token = '7WXgxlHNHfEpAE8Ei7//tgfNOCzp7H017txpUYo6C3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)