UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jupgx+49Ia711+kiTPg5xdd0rPRSp6/NNMW7ZRNlbW0='
WHERE
key_id = '60c882fbc9c79c6fb3be518742b6bf122f5c87d6f10a7972609c17e5974138eb'
AND (
token = 'jupgx+49Ia711+kiTPg5xdd0rPRSp6/NNMW7ZRNlbW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)