UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N4ytJUx6vxpSsAsCysNaPKBs1sKITUqFn47UWEPO4MU='
WHERE
key_id = '617dceca4d6b9e34355ac42d137bcab844c1ccaa8b20aa2cccfec0cc243cb26b'
AND (
token = 'N4ytJUx6vxpSsAsCysNaPKBs1sKITUqFn47UWEPO4MU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)