UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ouSzuiSp7jcSUreI3vCc5IBm4T5PEg7/yxlzIy9DiXE='
WHERE
key_id = 'a2f6499c1edae8b94d200fa8cf482d8e61e18969e0207d7a00ce105a312cc11b'
AND (
token = 'ouSzuiSp7jcSUreI3vCc5IBm4T5PEg7/yxlzIy9DiXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)