UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gOSt+ozCSAvI0livCwME3r0UR/FJLNKhhE2Oy3rwpkY='
WHERE
key_id = '47fb0657e9e9aeebc905bec4d0bd5146f7e5a5e170becf433d3aa68c8fe7c346'
AND (
token = 'gOSt+ozCSAvI0livCwME3r0UR/FJLNKhhE2Oy3rwpkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)