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