UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XjjkcNIOMhguXakfq6NOPj3LyvQF8kWfYiQCG90nfTA='
WHERE
key_id = '86e247539df5668d77cbb2bda908a0e42efe485e615e0c0b3db1f09b599b93ff'
AND (
token = 'XjjkcNIOMhguXakfq6NOPj3LyvQF8kWfYiQCG90nfTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)