UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xNf1tOdWLlfUKcNChIVH/yXj+xMCZFByETo8Pzt4Jok='
WHERE
key_id = '885f7b2346b58a3d3a8b1f85aa4f58aa42a07af4d845b4bda2b33781c7e9bdd2'
AND (
token = 'xNf1tOdWLlfUKcNChIVH/yXj+xMCZFByETo8Pzt4Jok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)