UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8uXgTBBTQ0xNY3dsu2WYO0rqsDttfWLYSfWqlwxQfzg='
WHERE
key_id = '43d78925cc86c98a17a90282e92d44e22a46510b96b09485519db158ee401e7d'
AND (
token = '8uXgTBBTQ0xNY3dsu2WYO0rqsDttfWLYSfWqlwxQfzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)