UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '58CbJMNY/e88nEqXrkg8H1iPPcdMv7iUBHBYh4BdLWc='
WHERE
key_id = 'd42c29316aa84c27318c1f73b24a5172932df3319112207616aa0638a90210da'
AND (
token = '58CbJMNY/e88nEqXrkg8H1iPPcdMv7iUBHBYh4BdLWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)