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