UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QTXShfyAg/843Ut14RWn0SnOdo/xPe+/mDUc/QwTRjo='
WHERE
key_id = 'e36cc46bd7aadc93221addbe0136db8540791d87a4281cdf0df19d42534c940e'
AND (
token = 'QTXShfyAg/843Ut14RWn0SnOdo/xPe+/mDUc/QwTRjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)