UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Li5YZc5oU1/n7TkdnNp+hO57D+xvEbg5kN7eM9zJAqE='
WHERE
key_id = '11576039e09ce51e0eb90f246e295fdd1ac20707385a41c47b5ea8be98a705d2'
AND (
token = 'Li5YZc5oU1/n7TkdnNp+hO57D+xvEbg5kN7eM9zJAqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)