UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVJ/9e225WKf8JDinEVUa+Mz1UvqHTQIiGOqxzs0CDg='
WHERE
key_id = 'ea107758d7bb7bf301fc14f6a92caba67d3cc93df3193e8c49cd938e3720b226'
AND (
token = 'dVJ/9e225WKf8JDinEVUa+Mz1UvqHTQIiGOqxzs0CDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)