UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4JdAZaTvHGjJQGmZYoKJD8nH/WUoZ3vMW5QcIGchTGQ='
WHERE
key_id = 'dabbe8652bfb12e0ad1528ebed9421592e2e05b54596d090404c5086ca4f2cd4'
AND (
token = '4JdAZaTvHGjJQGmZYoKJD8nH/WUoZ3vMW5QcIGchTGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)