UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYQFgnsoI88mAJ3reN7Bu/Wm3YFvsSSPYa0o0WK55Cs='
WHERE
key_id = 'da98f47f113d86808e1fb9a2eb34cd56387430c8ba7008a56dd2cf511298ae3f'
AND (
token = 'SYQFgnsoI88mAJ3reN7Bu/Wm3YFvsSSPYa0o0WK55Cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)