UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxBW47GHeDR/LjtOzZxsbOK7R8hZL14MwMXWuoPJ/Dw='
WHERE
key_id = '1959b70b1ec8a4fabd7f9f51ce48fcddb31dd748a0b17100750a438dd6c8ea91'
AND (
token = 'uxBW47GHeDR/LjtOzZxsbOK7R8hZL14MwMXWuoPJ/Dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)