UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't9WSYSaKquLE05W22ux13t7EfqzzPafs2cqR4eYLU+E='
WHERE
key_id = 'b169548fa5e67500611ff28103096c4270f02a331be6f89b0c46bb91f42a1b23'
AND (
token = 't9WSYSaKquLE05W22ux13t7EfqzzPafs2cqR4eYLU+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)