UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wk83imMVf/xJZWSvVw4YEg8qTLgqvPrtK0JNf9KQ+Ak='
WHERE
key_id = '47e116a7e11be5d2566ab9e7fd30ae74efb88cb3354a75a68d9b55eea8fb7c34'
AND (
token = 'Wk83imMVf/xJZWSvVw4YEg8qTLgqvPrtK0JNf9KQ+Ak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)