UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NUGrpxYxFnGHIiGnXg1+sLocvnKLXDG94nzUiaG4CEE='
WHERE
key_id = '14df1fb61c420d38cff8ac66dcbb7f4e8080c3dcc96140c9249076524dfc775f'
AND (
token = 'NUGrpxYxFnGHIiGnXg1+sLocvnKLXDG94nzUiaG4CEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)