UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UJGQ5JIR6rFt19ff/AAdauU23srYxdjYHhuhiv7c0gc='
WHERE
key_id = '4c00bc023a212d229e2de5344d9a3adcd00fd61b9f04b35a05955c06565a207a'
AND (
token = 'UJGQ5JIR6rFt19ff/AAdauU23srYxdjYHhuhiv7c0gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)